package day20.feifei.HomwWork;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.concurrent.*;

public class Score {
    int hei=0;
    public static void main(String[] args) throws Exception {
       List<Integer> list=new ArrayList<>();
        Scanner sc=new Scanner(System.in);
        int i = sc.nextInt();
        int j = sc.nextInt();
        for (int i1 = 0; i1 < i * j; i1++) {
            list.add(sc.nextInt());
        }
        ExecutorService threadPool = Executors.newFixedThreadPool(i);
        for(int m=0;m<i;m++){
            int num=m;
            Future<Integer> future = threadPool.submit(new Callable<Integer>() {
                @Override
                public Integer call() throws Exception {
                    Integer sum = (list.get(num* j) + list.get(num * j + 1) + list.get(num * j + 2));
                    return sum;
                }
            });
            Integer integer = future.get();
            System.out.println(integer);
        }

        threadPool.shutdown();
    }
}
